<template>
	<view class="wxc-elip" :class='line > 1 ? "elip--multiple" : ""' :style='style'>
		<slot></slot>
	</view>
</template>

<script>
	export default {
		props: {
			line: {
				type: Number,
				default: 1
			}
		},
		computed:{
			style(){
				let style = ""
				if(this.line>0) {
					style = "-webkit-line-clamp:" + this.line
				}
				return style
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style>
	.wxc-elip {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		/* word-break:break-all; */
		word-wrap: break-word;
	}

	.elip--multiple {
		white-space: normal;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}
</style>
